// TypeScript file
module view{
    export class GameViewGameSoundPanel extends eui.Component {
            public exit: eui.Button
            public sure: eui.Button
            public music: eui.ToggleButton
            public sound: eui.ToggleButton
            
            public constructor(){
                super();
                this.skinName=view.GameViewGameSound;
                this.music.selected=!SoundMenager.Shared().IsMusic;
                this.sound.selected=!SoundMenager.Shared().IsSound;
                this.exit.addEventListener(egret.TouchEvent.TOUCH_TAP, this.QuXiao, this)
                this.sure.addEventListener(egret.TouchEvent.TOUCH_TAP, this.QuXiao, this)
                this.music.addEventListener(egret.TouchEvent.TOUCH_TAP, this.SetMusic, this)
                this.sound.addEventListener(egret.TouchEvent.TOUCH_TAP, this.SetSound, this)
            }
            private QuXiao(e: egret.TouchEvent): void {//取消
                this.dispatchEventWith("quxiaoskin");
            }
            private SetMusic(e: egret.TouchEvent): void {
                SoundMenager.Shared().IsMusic = !SoundMenager.Shared().IsMusic;
            }
            private SetSound(e: egret.TouchEvent): void {
                SoundMenager.Shared().IsSound = !SoundMenager.Shared().IsSound;
            }
    }
}